'/
' RabNet (Rabid Networking)
' 
' This is a strimmed down BlitzMax port of RakNet. It is basically inspired
' by RakNet, but is very strimmed down, and a bunch of new additional
' features has been added, all written from scratch.
' 
' Copyright (c) 2003 Jenkins Software LLC.
' RabNet written 2010 by Anton Berlin.
' 
' =========================================================================
' 
' All new features is free to use in any way, as long as you inlude
' Anton Berlin (or Anthony Berlin) as the orinial writer of the code.
' 
' All old features are subject to the appropriate license agreement.
' Creative Commons Licensees are subject to the license found at
' http://creativecommons.org/licenses/by-nc/2.5/
' 
' Single application licensees are subject to the license found at
' http://www.jenkinssoftware.com/SingleApplicationLicense.html
' 
' Custom license users are subject to the terms therein.
' 
' GPL license users are subject to the GNU General Public
' License as published by the Free Software Foundation; either version 3
' of the License, or (at your option) any later version.
'/

type RabNetworkFactory extends Base

	'// -----------------------------------------------------------------------------------------------------------------
	'// Create and return a RabPeer instance.
	'// -----------------------------------------------------------------------------------------------------------------
	function createRabPeerInterface:RabPeer()
	
		return RabPeer.create();
	
	end function
	
	'// -----------------------------------------------------------------------------------------------------------------
	'// Destroy a RabPeer instance.
	'// -----------------------------------------------------------------------------------------------------------------
	function destroyRabPeerInterface(peer:RabPeer)
	
		if (peer.m_thisPeer) ..
			peer.m_thisPeer.destroy();
		
		peer.m_remoteSystemList.clear();
		peer.m_remoteSystemList = null;
		
		peer = null
		
		GCCollect();
	
	end function

end type
